﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Metadata.Edm;
using System.Data.Common;
using System.Data.Objects;
using AutoMapper;

namespace TransferData
{
    class Program
    {
        static void Main(string[] args)
        {
            TransferData();
        }

        static void TransferData()
        {
            var MSContext = new MSSqlContainer();
            var PGContext = new PostgresNoConstraintsContainer();

            PushPortals(PGContext, GetPortals(MSContext));
            PushAreas(PGContext, GetAreas(MSContext));
            PushContentCategories(PGContext, GetContentCategories(MSContext));
            PushContentComments(PGContext, GetContentComments(MSContext));
            PushContentPages(PGContext, GetContentPages(MSContext));
            PushCountries(PGContext, GetCountries(MSContext));
            PushEmailTemplates(PGContext, GetEmailTemplates(MSContext));
            PushFeedBackItems(PGContext, GetFeedBackItems(MSContext));
            PushForum_Forums(PGContext, GetForum_Forums(MSContext));
            PushForum_Posts(PGContext, GetForum_Posts(MSContext));
            PushForum_Votes(PGContext, GetForum_Votes(MSContext));
            PushLanguages(PGContext, GetLanguages(MSContext));
            PushLogs(PGContext, GetLogs(MSContext));
            PushModules(PGContext, GetModules(MSContext));
            PushOptIn_Attachments(PGContext, GetOptIn_Attachments(MSContext));
            PushOptIn_LinkTracking(PGContext, GetOptIn_LinkTracking(MSContext));
            PushOptIn_Lists(PGContext, GetOptIn_Lists(MSContext));
            PushOptIn_NewsLetterLists(PGContext, GetOptIn_NewsLetterLists(MSContext));
            PushOptIn_NewsLetters(PGContext, GetOptIn_NewsLetters(MSContext));
            PushOptIn_Subscribers(PGContext, GetOptIn_Subscribers(MSContext));
            PushOptIn_SubscribersLists(PGContext, GetOptIn_SubscribersLists(MSContext));
            PushOptIn_UsersLists(PGContext, GetOptIn_UsersLists(MSContext));
            PushPortalResources(PGContext, GetPortalResources(MSContext));
            PushPortalResourceTypes(PGContext, GetPortalResourceTypes(MSContext));            
            PushProfiles(PGContext, GetProfiles(MSContext));
            PushRedirects(PGContext, GetRedirects(MSContext));
            PushRoles(PGContext, GetRoles(MSContext));
            PushSearchLogs(PGContext, GetSearchLogs(MSContext));
            PushSocial_Data(PGContext, GetSocial_Data(MSContext));
            PushSocial_Images(PGContext, GetSocial_Images(MSContext));
            PushSocial_Likes(PGContext, GetSocial_Likes(MSContext));
            PushSocial_Messages(PGContext, GetSocial_Messages(MSContext));
            PushSocial_MessageTypes(PGContext, GetSocial_MessageTypes(MSContext));
            PushStateProvinces(PGContext, GetStateProvinces(MSContext));
            //PushStore_Carts(PGContext, GetStore_Carts(MSContext));
            //PushStore_Categories(PGContext, GetStore_Categories(MSContext));
            //PushStore_OrderDetails(PGContext, GetStore_OrderDetails(MSContext));
            //PushStore_Orders(PGContext, GetStore_Orders(MSContext));
            //PushStore_Payments(PGContext, GetStore_Payments(MSContext));
            //PushStore_PricingOptions(PGContext, GetStore_PricingOptions(MSContext));
            //PushStore_Products(PGContext, GetStore_Products(MSContext));
            //PushStore_Products_PricingOptions(PGContext, GetStore_Products_PricingOptions(MSContext));
            //PushStore_ShippingMethodRates(PGContext, GetStore_ShippingMethodRates(MSContext));
            //PushStore_ShippingMethods(PGContext, GetStore_ShippingMethods(MSContext));
            PushThemes(PGContext, GetThemes(MSContext));
            PushTracker_BugAttachments(PGContext, GetTracker_BugAttachments(MSContext));
            PushTracker_BugComments(PGContext, GetTracker_BugComments(MSContext));
            PushTracker_BugHistory(PGContext, GetTracker_BugHistory(MSContext));
            PushTracker_BugNotifications(PGContext, GetTracker_BugNotifications(MSContext));
            PushTracker_Bugs(PGContext, GetTracker_Bugs(MSContext));
            PushTracker_HelpPages(PGContext, GetTracker_HelpPages(MSContext));
            PushTracker_ProjectCategories(PGContext, GetTracker_ProjectCategories(MSContext));
            PushTracker_ProjectCustomFields(PGContext, GetTracker_ProjectCustomFields(MSContext));
            PushTracker_ProjectCustomFieldValues(PGContext, GetTracker_ProjectCustomFieldValues(MSContext));
            PushTracker_ProjectMembers(PGContext, GetTracker_ProjectMembers(MSContext));
            PushTracker_ProjectMilestones(PGContext, GetTracker_ProjectMilestones(MSContext));
            PushTracker_ProjectNotifications(PGContext, GetTracker_ProjectNotifications(MSContext));
            PushTracker_ProjectPriorities(PGContext, GetTracker_ProjectPriorities(MSContext));
            PushTracker_Projects(PGContext, GetTracker_Projects(MSContext));
            PushTracker_ProjectStatuses(PGContext, GetTracker_ProjectStatuses(MSContext));
            PushTracker_TicketAttachments(PGContext, GetTracker_TicketAttachments(MSContext));
            PushTracker_TicketComments(PGContext, GetTracker_TicketComments(MSContext));
            PushTracker_TicketHistory(PGContext, GetTracker_TicketHistory(MSContext));
            PushTracker_TicketNotifications(PGContext, GetTracker_TicketNotifications(MSContext));
            PushTracker_Tickets(PGContext, GetTracker_Tickets(MSContext));
            PushUsers(PGContext, GetUsers(MSContext));
            PushUsersInRoles(PGContext, GetUsersInRoles(MSContext));
            PushWeightedContents(PGContext, GetWeightedContents(MSContext));
            PushWeightedContentModules(PGContext, GetWeightedContentModules(MSContext));
            PushWeightedContentModulesRoles(PGContext, GetWeightedContentModulesRoles(MSContext));
            PushWeightedContentWidgets(PGContext, GetWeightedContentWidgets(MSContext));
            PushWeightedContentWidgetsRoles(PGContext, GetWeightedContentWidgetsRoles(MSContext));
            PushWidgets(PGContext, GetWidgets(MSContext));
            PushWiki_Contents(PGContext, GetWiki_Contents(MSContext));
            PushWiki_Settings(PGContext, GetWiki_Settings(MSContext));
            PushWiki_Titles(PGContext, GetWiki_Titles(MSContext));
            PushZones(PGContext, GetZones(MSContext));
        }

        #region Push To Postgres
        static void PushAreas(PostgresNoConstraintsContainer context, List<Area> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Area, cms_areas>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Area, cms_areas>(entity);
                context.cms_areas.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushContentCategories(PostgresNoConstraintsContainer context, List<ContentCategory> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<ContentCategory, cms_content_categories>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<ContentCategory, cms_content_categories>(entity);
                context.cms_content_categories.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushContentComments(PostgresNoConstraintsContainer context, List<ContentComment> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<ContentComment, cms_content_comments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<ContentComment, cms_content_comments>(entity);
                context.cms_content_comments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushContentPages(PostgresNoConstraintsContainer context, List<ContentPage> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<ContentPage, cms_content_pages>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<ContentPage, cms_content_pages>(entity);
                context.cms_content_pages.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushCountries(PostgresNoConstraintsContainer context, List<Country> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Country, country>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Country, country>(entity);
                context.countries.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushEmailTemplates(PostgresNoConstraintsContainer context, List<EmailTemplate> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<EmailTemplate, cms_email_templates>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<EmailTemplate, cms_email_templates>(entity);
                context.cms_email_templates.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushFeedBackItems(PostgresNoConstraintsContainer context, List<FeedBackItem> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<FeedBackItem, cms_feedback_items>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<FeedBackItem, cms_feedback_items>(entity);
                context.cms_feedback_items.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushForum_Forums(PostgresNoConstraintsContainer context, List<Forum_Forums> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Forum_Forums, forum_forums>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Forum_Forums, forum_forums>(entity);
                context.forum_forums.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushForum_Posts(PostgresNoConstraintsContainer context, List<Forum_Posts> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Forum_Posts, forum_posts>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Forum_Posts, forum_posts>(entity);
                context.forum_posts.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushForum_Votes(PostgresNoConstraintsContainer context, List<Forum_Votes> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Forum_Votes, forum_votes>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Forum_Votes, forum_votes>(entity);
                context.forum_votes.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushLanguages(PostgresNoConstraintsContainer context, List<Language> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Language, language>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Language, language>(entity);
                context.languages.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushLogs(PostgresNoConstraintsContainer context, List<Log> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Log, cms_log>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Log, cms_log>(entity);
                context.cms_log.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushModules(PostgresNoConstraintsContainer context, List<Module> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Module, cms_modules>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Module, cms_modules>(entity);
                context.cms_modules.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_Attachments(PostgresNoConstraintsContainer context, List<OptIn_Attachments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_Attachments, optin_attachments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_Attachments, optin_attachments>(entity);
                context.optin_attachments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_LinkTracking(PostgresNoConstraintsContainer context, List<OptIn_LinkTracking> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_LinkTracking, optin_link_tracking>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_LinkTracking, optin_link_tracking>(entity);
                context.optin_link_tracking.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_Lists(PostgresNoConstraintsContainer context, List<OptIn_Lists> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_Lists, optin_lists>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_Lists, optin_lists>(entity);
                context.optin_lists.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_NewsLetterLists(PostgresNoConstraintsContainer context, List<OptIn_NewsLetterLists> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_NewsLetterLists, optin_newsletter_lists>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_NewsLetterLists, optin_newsletter_lists>(entity);
                context.optin_newsletter_lists.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_NewsLetters(PostgresNoConstraintsContainer context, List<OptIn_NewsLetters> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_NewsLetters, optin_newsletters>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_NewsLetters, optin_newsletters>(entity);
                context.optin_newsletters.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_Subscribers(PostgresNoConstraintsContainer context, List<OptIn_Subscribers> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_Subscribers, optin_subscribers>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_Subscribers, optin_subscribers>(entity);
                context.optin_subscribers.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_SubscribersLists(PostgresNoConstraintsContainer context, List<OptIn_SubscribersLists> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_SubscribersLists, optin_subscribers_lists>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_SubscribersLists, optin_subscribers_lists>(entity);
                context.optin_subscribers_lists.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushOptIn_UsersLists(PostgresNoConstraintsContainer context, List<OptIn_UsersLists> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<OptIn_UsersLists, optin_users_lists>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<OptIn_UsersLists, optin_users_lists>(entity);
                context.optin_users_lists.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushPortalResources(PostgresNoConstraintsContainer context, List<PortalResource> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<PortalResource, cms_portal_resources>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<PortalResource, cms_portal_resources>(entity);
                context.cms_portal_resources.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushPortalResourceTypes(PostgresNoConstraintsContainer context, List<PortalResourceType> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<PortalResourceType, cms_portal_resource_types>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<PortalResourceType, cms_portal_resource_types>(entity);
                context.cms_portal_resource_types.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushPortals(PostgresNoConstraintsContainer context, List<Portal> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Portal, cms_portals>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Portal, cms_portals>(entity);
                context.cms_portals.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushProfiles(PostgresNoConstraintsContainer context, List<Profile> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Profile, cms_profiles>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Profile, cms_profiles>(entity);
                context.cms_profiles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushRedirects(PostgresNoConstraintsContainer context, List<Redirect> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Redirect, cms_redirects>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Redirect, cms_redirects>(entity);
                context.cms_redirects.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushRoles(PostgresNoConstraintsContainer context, List<Role> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Role, role>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Role, role>(entity);
                context.roles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSearchLogs(PostgresNoConstraintsContainer context, List<SearchLog> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<SearchLog, cms_search_log>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<SearchLog, cms_search_log>(entity);
                context.cms_search_log.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSocial_Data(PostgresNoConstraintsContainer context, List<Social_Data> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Social_Data, social_data>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Social_Data, social_data>(entity);
                context.social_data.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSocial_Images(PostgresNoConstraintsContainer context, List<Social_Images> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Social_Images, social_images>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Social_Images, social_images>(entity);
                context.social_images.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSocial_Likes(PostgresNoConstraintsContainer context, List<Social_Likes> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Social_Likes, social_likes>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Social_Likes, social_likes>(entity);
                context.social_likes.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSocial_Messages(PostgresNoConstraintsContainer context, List<Social_Messages> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Social_Messages, social_messages>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Social_Messages, social_messages>(entity);
                context.social_messages.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushSocial_MessageTypes(PostgresNoConstraintsContainer context, List<Social_MessageTypes> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Social_MessageTypes, social_messagetypes>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Social_MessageTypes, social_messagetypes>(entity);
                context.social_messagetypes.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStateProvinces(PostgresNoConstraintsContainer context, List<StateProvince> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<StateProvince, state_provinces>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<StateProvince, state_provinces>(entity);
                context.state_provinces.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Carts(PostgresNoConstraintsContainer context, List<Store_Carts> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Carts, store_carts>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Carts, store_carts>(entity);
                context.store_carts.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Categories(PostgresNoConstraintsContainer context, List<Store_Categories> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Categories, store_categories>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Categories, store_categories>(entity);
                context.store_categories.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_OrderDetails(PostgresNoConstraintsContainer context, List<Store_OrderDetails> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_OrderDetails, store_order_details>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_OrderDetails, store_order_details>(entity);
                context.store_order_details.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Orders(PostgresNoConstraintsContainer context, List<Store_Orders> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Orders, store_orders>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Orders, store_orders>(entity);
                context.store_orders.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Payments(PostgresNoConstraintsContainer context, List<Store_Payments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Payments, store_payments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Payments, store_payments>(entity);
                context.store_payments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_PricingOptions(PostgresNoConstraintsContainer context, List<Store_PricingOptions> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_PricingOptions, store_pricing_options>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_PricingOptions, store_pricing_options>(entity);
                context.store_pricing_options.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Products(PostgresNoConstraintsContainer context, List<Store_Products> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Products, store_products>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Products, store_products>(entity);
                context.store_products.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_Products_PricingOptions(PostgresNoConstraintsContainer context, List<Store_Products_PricingOptions> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_Products_PricingOptions, store_products_pricing_options>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_Products_PricingOptions, store_products_pricing_options>(entity);
                context.store_products_pricing_options.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_ShippingMethodRates(PostgresNoConstraintsContainer context, List<Store_ShippingMethodRates> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_ShippingMethodRates, store_shipping_method_rates>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_ShippingMethodRates, store_shipping_method_rates>(entity);
                context.store_shipping_method_rates.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushStore_ShippingMethods(PostgresNoConstraintsContainer context, List<Store_ShippingMethods> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Store_ShippingMethods, store_shipping_methods>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Store_ShippingMethods, store_shipping_methods>(entity);
                context.store_shipping_methods.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushThemes(PostgresNoConstraintsContainer context, List<Theme> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Theme, cms_themes>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Theme, cms_themes>(entity);
                context.cms_themes.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_BugAttachments(PostgresNoConstraintsContainer context, List<Tracker_BugAttachments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_BugAttachments, tracker_bug_attachments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_BugAttachments, tracker_bug_attachments>(entity);
                context.tracker_bug_attachments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_BugComments(PostgresNoConstraintsContainer context, List<Tracker_BugComments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_BugComments, tracker_bug_comments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_BugComments, tracker_bug_comments>(entity);
                context.tracker_bug_comments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_BugHistory(PostgresNoConstraintsContainer context, List<Tracker_BugHistory> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_BugHistory, tracker_bug_history>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_BugHistory, tracker_bug_history>(entity);
                context.tracker_bug_history.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_BugNotifications(PostgresNoConstraintsContainer context, List<Tracker_BugNotifications> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_BugNotifications, tracker_bug_notifications>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_BugNotifications, tracker_bug_notifications>(entity);
                context.tracker_bug_notifications.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_Bugs(PostgresNoConstraintsContainer context, List<Tracker_Bugs> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_Bugs, tracker_bugs>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_Bugs, tracker_bugs>(entity);
                context.tracker_bugs.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_HelpPages(PostgresNoConstraintsContainer context, List<Tracker_HelpPages> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_HelpPages, tracker_help_pages>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_HelpPages, tracker_help_pages>(entity);
                context.tracker_help_pages.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectCategories(PostgresNoConstraintsContainer context, List<Tracker_ProjectCategories> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectCategories, tracker_project_categories>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectCategories, tracker_project_categories>(entity);
                context.tracker_project_categories.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectCustomFields(PostgresNoConstraintsContainer context, List<Tracker_ProjectCustomFields> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectCustomFields, tracker_project_customfields>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectCustomFields, tracker_project_customfields>(entity);
                context.tracker_project_customfields.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectCustomFieldValues(PostgresNoConstraintsContainer context, List<Tracker_ProjectCustomFieldValues> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectCustomFieldValues, tracker_project_custom_field_values>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectCustomFieldValues, tracker_project_custom_field_values>(entity);
                context.tracker_project_custom_field_values.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectMembers(PostgresNoConstraintsContainer context, List<Tracker_ProjectMembers> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectMembers, tracker_project_members>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectMembers, tracker_project_members>(entity);
                context.tracker_project_members.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectMilestones(PostgresNoConstraintsContainer context, List<Tracker_ProjectMilestones> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectMilestones, tracker_project_milestones>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectMilestones, tracker_project_milestones>(entity);
                context.tracker_project_milestones.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectNotifications(PostgresNoConstraintsContainer context, List<Tracker_ProjectNotifications> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectNotifications, tracker_project_notifications>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectNotifications, tracker_project_notifications>(entity);
                context.tracker_project_notifications.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectPriorities(PostgresNoConstraintsContainer context, List<Tracker_ProjectPriorities> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectPriorities, tracker_project_priorities>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectPriorities, tracker_project_priorities>(entity);
                context.tracker_project_priorities.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_Projects(PostgresNoConstraintsContainer context, List<Tracker_Projects> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_Projects, tracker_projects>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_Projects, tracker_projects>(entity);
                context.tracker_projects.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_ProjectStatuses(PostgresNoConstraintsContainer context, List<Tracker_ProjectStatuses> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_ProjectStatuses, tracker_project_statuses>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_ProjectStatuses, tracker_project_statuses>(entity);
                context.tracker_project_statuses.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_TicketAttachments(PostgresNoConstraintsContainer context, List<Tracker_TicketAttachments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_TicketAttachments, tracker_ticket_attachments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_TicketAttachments, tracker_ticket_attachments>(entity);
                context.tracker_ticket_attachments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_TicketComments(PostgresNoConstraintsContainer context, List<Tracker_TicketComments> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_TicketComments, tracker_ticket_comments>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_TicketComments, tracker_ticket_comments>(entity);
                context.tracker_ticket_comments.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_TicketHistory(PostgresNoConstraintsContainer context, List<Tracker_TicketHistory> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_TicketHistory, tracker_ticket_history>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_TicketHistory, tracker_ticket_history>(entity);
                context.tracker_ticket_history.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_TicketNotifications(PostgresNoConstraintsContainer context, List<Tracker_TicketNotifications> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_TicketNotifications, tracker_ticket_notifications>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_TicketNotifications, tracker_ticket_notifications>(entity);
                context.tracker_ticket_notifications.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushTracker_Tickets(PostgresNoConstraintsContainer context, List<Tracker_Tickets> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Tracker_Tickets, tracker_tickets>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Tracker_Tickets, tracker_tickets>(entity);
                context.tracker_tickets.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushUsers(PostgresNoConstraintsContainer context, List<User> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<User, user>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<User, user>(entity);
                context.users.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushUsersInRoles(PostgresNoConstraintsContainer context, List<UsersInRole> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<UsersInRole, usersinrole>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<UsersInRole, usersinrole>(entity);
                context.usersinroles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWeightedContents(PostgresNoConstraintsContainer context, List<WeightedContent> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<WeightedContent, weighted_content>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<WeightedContent, weighted_content>(entity);
                context.weighted_content.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWeightedContentModules(PostgresNoConstraintsContainer context, List<WeightedContentModule> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<WeightedContentModule, weighted_content_modules>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<WeightedContentModule, weighted_content_modules>(entity);
                context.weighted_content_modules.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWeightedContentModulesRoles(PostgresNoConstraintsContainer context, List<WeightedContentModulesRole> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<WeightedContentModulesRole, weighted_content_modules_roles>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<WeightedContentModulesRole, weighted_content_modules_roles>(entity);
                context.weighted_content_modules_roles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWeightedContentWidgets(PostgresNoConstraintsContainer context, List<WeightedContentWidget> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<WeightedContentWidget, weighted_content_widgets>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<WeightedContentWidget, weighted_content_widgets>(entity);
                context.weighted_content_widgets.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWeightedContentWidgetsRoles(PostgresNoConstraintsContainer context, List<WeightedContentWidgetsRole> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<WeightedContentWidgetsRole, weighted_content_widgets_roles>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<WeightedContentWidgetsRole, weighted_content_widgets_roles>(entity);
                context.weighted_content_widgets_roles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWidgets(PostgresNoConstraintsContainer context, List<Widget> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Widget, cms_widgets>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Widget, cms_widgets>(entity);
                context.cms_widgets.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWiki_Contents(PostgresNoConstraintsContainer context, List<Wiki_Contents> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Wiki_Contents, wiki_contents>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Wiki_Contents, wiki_contents>(entity);
                context.wiki_contents.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWiki_Settings(PostgresNoConstraintsContainer context, List<Wiki_Settings> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Wiki_Settings, wiki_settings>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Wiki_Settings, wiki_settings>(entity);
                context.wiki_settings.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushWiki_Titles(PostgresNoConstraintsContainer context, List<Wiki_Titles> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Wiki_Titles, wiki_titles>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Wiki_Titles, wiki_titles>(entity);
                context.wiki_titles.AddObject(mapped);
                context.SaveChanges();
            }
        }
        static void PushZones(PostgresNoConstraintsContainer context, List<Zone> entities)
        {
            foreach (var entity in entities)
            {
                Mapper.CreateMap<Zone, cms_zones>().ForMember(e => e.EntityKey, opt => opt.Ignore());
                var mapped = Mapper.Map<Zone, cms_zones>(entity);
                context.cms_zones.AddObject(mapped);
                context.SaveChanges();
            }
        }
        #endregion

        #region Get Table Data from MSSql
        static List<Area> GetAreas(MSSqlContainer context)
        {
            return (from c in context.Areas select c).ToList();
        }
        static List<ContentCategory> GetContentCategories(MSSqlContainer context)
        {
            return (from c in context.ContentCategories select c).ToList();
        }
        static List<ContentComment> GetContentComments(MSSqlContainer context)
        {
            return (from c in context.ContentComments select c).ToList();
        }
        static List<ContentPage> GetContentPages(MSSqlContainer context)
        {
            return (from c in context.ContentPages select c).ToList();
        }
        static List<Country> GetCountries(MSSqlContainer context)
        {
            return (from c in context.Countries select c).ToList();
        }
        static List<EmailTemplate> GetEmailTemplates(MSSqlContainer context)
        {
            return (from c in context.EmailTemplates select c).ToList();
        }
        static List<FeedBackItem> GetFeedBackItems(MSSqlContainer context)
        {
            return (from c in context.FeedBackItems select c).ToList();
        }
        static List<Forum_Forums> GetForum_Forums(MSSqlContainer context)
        {
            return (from c in context.Forum_Forums select c).ToList();
        }
        static List<Forum_Posts> GetForum_Posts(MSSqlContainer context)
        {
            return (from c in context.Forum_Posts select c).ToList();
        }
        static List<Forum_Votes> GetForum_Votes(MSSqlContainer context)
        {
            return (from c in context.Forum_Votes select c).ToList();
        }
        static List<Language> GetLanguages(MSSqlContainer context)
        {
            return (from c in context.Languages select c).ToList();
        }
        static List<Log> GetLogs(MSSqlContainer context)
        {
            return (from c in context.Logs select c).ToList();
        }
        static List<Module> GetModules(MSSqlContainer context)
        {
            return (from c in context.Modules select c).ToList();
        }
        static List<OptIn_Attachments> GetOptIn_Attachments(MSSqlContainer context)
        {
            return (from c in context.OptIn_Attachments select c).ToList();
        }
        static List<OptIn_LinkTracking> GetOptIn_LinkTracking(MSSqlContainer context)
        {
            return (from c in context.OptIn_LinkTracking select c).ToList();
        }
        static List<OptIn_Lists> GetOptIn_Lists(MSSqlContainer context)
        {
            return (from c in context.OptIn_Lists select c).ToList();
        }
        static List<OptIn_NewsLetterLists> GetOptIn_NewsLetterLists(MSSqlContainer context)
        {
            return (from c in context.OptIn_NewsLetterLists select c).ToList();
        }
        static List<OptIn_NewsLetters> GetOptIn_NewsLetters(MSSqlContainer context)
        {
            return (from c in context.OptIn_NewsLetters select c).ToList();
        }
        static List<OptIn_Subscribers> GetOptIn_Subscribers(MSSqlContainer context)
        {
            return (from c in context.OptIn_Subscribers select c).ToList();
        }
        static List<OptIn_SubscribersLists> GetOptIn_SubscribersLists(MSSqlContainer context)
        {
            return (from c in context.OptIn_SubscribersLists select c).ToList();
        }
        static List<OptIn_UsersLists> GetOptIn_UsersLists(MSSqlContainer context)
        {
            return (from c in context.OptIn_UsersLists select c).ToList();
        }
        static List<PortalResource> GetPortalResources(MSSqlContainer context)
        {
            return (from c in context.PortalResources select c).ToList();
        }
        static List<PortalResourceType> GetPortalResourceTypes(MSSqlContainer context)
        {
            return (from c in context.PortalResourceTypes select c).ToList();
        }
        static List<Portal> GetPortals(MSSqlContainer context)
        {
            return (from c in context.Portals select c).ToList();
        }
        static List<Profile> GetProfiles(MSSqlContainer context)
        {
            return (from c in context.Profiles select c).ToList();
        }
        static List<Redirect> GetRedirects(MSSqlContainer context)
        {
            return (from c in context.Redirects select c).ToList();
        }
        static List<Role> GetRoles(MSSqlContainer context)
        {
            return (from c in context.Roles select c).ToList();
        }
        static List<SearchLog> GetSearchLogs(MSSqlContainer context)
        {
            return (from c in context.SearchLogs select c).ToList();
        }
        static List<Social_Data> GetSocial_Data(MSSqlContainer context)
        {
            return (from c in context.Social_Data select c).ToList();
        }
        static List<Social_Images> GetSocial_Images(MSSqlContainer context)
        {
            return (from c in context.Social_Images select c).ToList();
        }
        static List<Social_Likes> GetSocial_Likes(MSSqlContainer context)
        {
            return (from c in context.Social_Likes select c).ToList();
        }
        static List<Social_Messages> GetSocial_Messages(MSSqlContainer context)
        {
            return (from c in context.Social_Messages select c).ToList();
        }
        static List<Social_MessageTypes> GetSocial_MessageTypes(MSSqlContainer context)
        {
            return (from c in context.Social_MessageTypes select c).ToList();
        }
        static List<StateProvince> GetStateProvinces(MSSqlContainer context)
        {
            return (from c in context.StateProvinces select c).ToList();
        }
        static List<Store_Carts> GetStore_Carts(MSSqlContainer context)
        {
            return (from c in context.Store_Carts select c).ToList();
        }
        static List<Store_Categories> GetStore_Categories(MSSqlContainer context)
        {
            return (from c in context.Store_Categories select c).ToList();
        }
        static List<Store_OrderDetails> GetStore_OrderDetails(MSSqlContainer context)
        {
            return (from c in context.Store_OrderDetails select c).ToList();
        }
        static List<Store_Orders> GetStore_Orders(MSSqlContainer context)
        {
            return (from c in context.Store_Orders select c).ToList();
        }
        static List<Store_Payments> GetStore_Payments(MSSqlContainer context)
        {
            return (from c in context.Store_Payments select c).ToList();
        }
        static List<Store_PricingOptions> GetStore_PricingOptions(MSSqlContainer context)
        {
            return (from c in context.Store_PricingOptions select c).ToList();
        }
        static List<Store_Products> GetStore_Products(MSSqlContainer context)
        {
            return (from c in context.Store_Products select c).ToList();
        }
        static List<Store_Products_PricingOptions> GetStore_Products_PricingOptions(MSSqlContainer context)
        {
            return (from c in context.Store_Products_PricingOptions select c).ToList();
        }
        static List<Store_ShippingMethodRates> GetStore_ShippingMethodRates(MSSqlContainer context)
        {
            return (from c in context.Store_ShippingMethodRates select c).ToList();
        }
        static List<Store_ShippingMethods> GetStore_ShippingMethods(MSSqlContainer context)
        {
            return (from c in context.Store_ShippingMethods select c).ToList();
        }
        static List<Theme> GetThemes(MSSqlContainer context)
        {
            return (from c in context.Themes select c).ToList();
        }
        static List<Tracker_BugAttachments> GetTracker_BugAttachments(MSSqlContainer context)
        {
            return (from c in context.Tracker_BugAttachments select c).ToList();
        }
        static List<Tracker_BugComments> GetTracker_BugComments(MSSqlContainer context)
        {
            return (from c in context.Tracker_BugComments select c).ToList();
        }
        static List<Tracker_BugHistory> GetTracker_BugHistory(MSSqlContainer context)
        {
            return (from c in context.Tracker_BugHistory select c).ToList();
        }
        static List<Tracker_BugNotifications> GetTracker_BugNotifications(MSSqlContainer context)
        {
            return (from c in context.Tracker_BugNotifications select c).ToList();
        }
        static List<Tracker_Bugs> GetTracker_Bugs(MSSqlContainer context)
        {
            return (from c in context.Tracker_Bugs select c).ToList();
        }
        static List<Tracker_HelpPages> GetTracker_HelpPages(MSSqlContainer context)
        {
            return (from c in context.Tracker_HelpPages select c).ToList();
        }
        static List<Tracker_ProjectCategories> GetTracker_ProjectCategories(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectCategories select c).ToList();
        }
        static List<Tracker_ProjectCustomFields> GetTracker_ProjectCustomFields(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectCustomFields select c).ToList();
        }
        static List<Tracker_ProjectCustomFieldValues> GetTracker_ProjectCustomFieldValues(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectCustomFieldValues select c).ToList();
        }
        static List<Tracker_ProjectMembers> GetTracker_ProjectMembers(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectMembers select c).ToList();
        }
        static List<Tracker_ProjectMilestones> GetTracker_ProjectMilestones(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectMilestones select c).ToList();
        }
        static List<Tracker_ProjectNotifications> GetTracker_ProjectNotifications(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectNotifications select c).ToList();
        }
        static List<Tracker_ProjectPriorities> GetTracker_ProjectPriorities(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectPriorities select c).ToList();
        }
        static List<Tracker_Projects> GetTracker_Projects(MSSqlContainer context)
        {
            return (from c in context.Tracker_Projects select c).ToList();
        }
        static List<Tracker_ProjectStatuses> GetTracker_ProjectStatuses(MSSqlContainer context)
        {
            return (from c in context.Tracker_ProjectStatuses select c).ToList();
        }
        static List<Tracker_TicketAttachments> GetTracker_TicketAttachments(MSSqlContainer context)
        {
            return (from c in context.Tracker_TicketAttachments select c).ToList();
        }
        static List<Tracker_TicketComments> GetTracker_TicketComments(MSSqlContainer context)
        {
            return (from c in context.Tracker_TicketComments select c).ToList();
        }
        static List<Tracker_TicketHistory> GetTracker_TicketHistory(MSSqlContainer context)
        {
            return (from c in context.Tracker_TicketHistory select c).ToList();
        }
        static List<Tracker_TicketNotifications> GetTracker_TicketNotifications(MSSqlContainer context)
        {
            return (from c in context.Tracker_TicketNotifications select c).ToList();
        }
        static List<Tracker_Tickets> GetTracker_Tickets(MSSqlContainer context)
        {
            return (from c in context.Tracker_Tickets select c).ToList();
        }
        static List<User> GetUsers(MSSqlContainer context)
        {
            return (from c in context.Users select c).ToList();
        }
        static List<UsersInRole> GetUsersInRoles(MSSqlContainer context)
        {
            return (from c in context.UsersInRoles select c).ToList();
        }
        static List<WeightedContent> GetWeightedContents(MSSqlContainer context)
        {
            return (from c in context.WeightedContents select c).ToList();
        }
        static List<WeightedContentModule> GetWeightedContentModules(MSSqlContainer context)
        {
            return (from c in context.WeightedContentModules select c).ToList();
        }
        static List<WeightedContentModulesRole> GetWeightedContentModulesRoles(MSSqlContainer context)
        {
            return (from c in context.WeightedContentModulesRoles select c).ToList();
        }
        static List<WeightedContentWidget> GetWeightedContentWidgets(MSSqlContainer context)
        {
            return (from c in context.WeightedContentWidgets select c).ToList();
        }
        static List<WeightedContentWidgetsRole> GetWeightedContentWidgetsRoles(MSSqlContainer context)
        {
            return (from c in context.WeightedContentWidgetsRoles select c).ToList();
        }
        static List<Widget> GetWidgets(MSSqlContainer context)
        {
            return (from c in context.Widgets select c).ToList();
        }
        static List<Wiki_Contents> GetWiki_Contents(MSSqlContainer context)
        {
            return (from c in context.Wiki_Contents select c).ToList();
        }
        static List<Wiki_Settings> GetWiki_Settings(MSSqlContainer context)
        {
            return (from c in context.Wiki_Settings select c).ToList();
        }
        static List<Wiki_Titles> GetWiki_Titles(MSSqlContainer context)
        {
            return (from c in context.Wiki_Titles select c).ToList();
        }
        static List<Zone> GetZones(MSSqlContainer context)
        {
            return (from c in context.Zones select c).ToList();
        }     
        #endregion

        //Areas
        //ContentCategories
        //ContentComments
        //ContentPages
        //Countries
        //EmailTemplates
        //FeedBackItems
        //Forum_Forums
        //Forum_Posts
        //Forum_Votes
        //Languages
        //Log
        //Modules
        //OptIn_Attachments
        //OptIn_LinkTracking
        //OptIn_Lists
        //OptIn_NewsLetterLists
        //OptIn_NewsLetters
        //OptIn_Subscribers
        //OptIn_SubscribersLists
        //OptIn_UsersLists
        //PortalResources
        //PortalResourceTypes
        //Portals
        //Profiles
        //Redirects
        //Roles
        //SearchLog
        //Social_Data
        //Social_Images
        //Social_Likes
        //Social_Messages
        //Social_MessageTypes
        //StateProvinces
        //Store_Carts
        //Store_Categories
        //Store_OrderDetails
        //Store_Orders
        //Store_Payments
        //Store_PricingOptions
        //Store_Products
        //Store_Products_PricingOptions
        //Store_ShippingMethodRates
        //Store_ShippingMethods
        //Themes
        //Tracker_BugAttachments
        //Tracker_BugComments
        //Tracker_BugHistory
        //Tracker_BugNotifications
        //Tracker_Bugs
        //Tracker_HelpPages
        //Tracker_ProjectCategories
        //Tracker_ProjectCustomFields
        //Tracker_ProjectCustomFieldValues
        //Tracker_ProjectMembers
        //Tracker_ProjectMilestones
        //Tracker_ProjectNotifications
        //Tracker_ProjectPriorities
        //Tracker_Projects
        //Tracker_ProjectStatuses
        //Tracker_TicketAttachments
        //Tracker_TicketComments
        //Tracker_TicketHistory
        //Tracker_TicketNotifications
        //Tracker_Tickets
        //Users
        //UsersInRoles
        //WeightedContent
        //WeightedContentModules
        //WeightedContentModulesRoles
        //WeightedContentWidgets
        //WeightedContentWidgetsRoles
        //Widgets
        //Wiki_Contents
        //Wiki_Settings
        //Wiki_Titles
        //Zones

    }
}
